package com.callbox.frontend;


import java.util.ArrayList;
import java.util.List;

import com.callbox.R;
import com.callbox.dao.ClsMessageDAO;
import com.callbox.entity.ClsMessage;

import android.os.Bundle;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.support.v4.app.NavUtils;



public class MessageActivity extends Activity {

	static final String[] MOBILE_OS = 
            new String[] { "Android", "iOS", "WindowsMobile", "Blackberry"};
	
	
	
	private final List arrayMessages = new ArrayList();
	
	
	 @Override
	    public void onCreate(Bundle savedInstanceState) {		 
		 
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.activity_message);
	        //setListAdapter(new MessageArrayAdapter(this, MOBILE_OS));
	        MessageArrayAdapter adaptador = new MessageArrayAdapter(this);        
			
			ListView lstActividades = (ListView) findViewById(R.id.lstMessage);
			
			List<ClsMessage> List = ClsMessageDAO.Instance().ListByMobile(this, 0);
			
	    }
	  @Override
	    public boolean onCreateOptionsMenu(Menu menu) {
	        getMenuInflater().inflate(R.menu.activity_records, menu);
	        return true;
	    }
	 
	  class MessageArrayAdapter extends ArrayAdapter{
						
			Activity context;
			MessageArrayAdapter(Activity context)
			{
				super(context, R.layout.list_message, arrayMessages);
				this.context = context;
			}
			
		 
			@Override
			public View getView(int position, View convertView, ViewGroup parent) {
				LayoutInflater inflater = context.getLayoutInflater();
				View item = inflater.inflate(R.layout.list_message, null);
				
				/*
				Actividad objA = (Actividad) arrayActividades.get(position);
				
				TextView lblActividad = (TextView)item.findViewById(R.id.txtActividad);
				lblActividad.setText(objA.getVc_titulo());
				
				TextView lblEstado = (TextView)item.findViewById(R.id.txtEstado);*
				if (objA.getEstado_equipo().equals("P"))
					lblEstado.setText("Pendiente");
				else if (objA.getEstado_equipo().equals("I"))
					lblEstado.setText("Iniciada");
				else if (objA.getEstado_equipo().equals("F"))
					lblEstado.setText("Finalizada");*/
				
				return(item);
			}
		}
}
